<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			#div1{
				border: 5px red solid;
				height: 300px;
			}
			
			p{
				border: 5px red solid;
			}
		</style>
	</head>
	<body>
		<div id="div1">
			我是div
			<p>我是段落</p>
		</div>
		<img src="img/shanhu-001.jpg" />
		<button onclick="changeImg()" style="height: 50px;width: 100px;font-size: 30px;">按钮</button>
	</body>
	<script type="text/javascript">
		function changeImg(){
			var img = document.getElementsByTagName("img")[0];
			img.setAttribute("src","img/shanhu-003.jpg");
		}
		var div1 = document.getElementById("div1");
		div1.style.fontSize = "30px";
		div1.style.backgroundColor = "green";
		
		var innertHtml = div1.innerHTML;
		console.log(innertHtml);
		var innerText = div1.innerText;
		console.log(innerText);
		div1.style.borderColor = "blue";
		
		
		
	</script>
</html>
